<template>
  <el-menu
    active-text-color="#ffd04b"
    background-color="#545c64"
    class="aside-container"
    default-active="2"
    text-color="#fff"
    @open="handleOpen"
    @close="handleClose"
    :collapse="isCollapse"
  >
    <p class="logo-lg">{{ isCollapse ? 'DIDI' : '阿开陪诊' }}</p>
    <TreeMenu :menuData="menuData" :index="1" />
  </el-menu>
</template>

<script setup>
import TreeMenu from './treeMenu.vue'
import { useRouter } from 'vue-router'
import { reactive } from 'vue'
import { computed } from 'vue'
import { useStore } from 'vuex'
const router = useRouter()
const store = useStore()

const isCollapse = computed(() => store.state.menu.isCollapse) // 控制侧边导航栏展开收起
const menuData = reactive(router.options.routes[0].children)
const handleOpen = (key, keyPath) => {}
const handleClose = () => {}
</script>

<style scoped lang="less">
.aside-container {
  height: 100vh;
  .logo-lg {
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
}
</style>
